EMT Practice Test

1. Question Content...


Question List

Question1: Which exception type cannot be caught ?

Question2: Which action may cause triggers to fire?

Question3: A Visual Flow uses an apex Action to provide additional information about multiple Contacts, stored in a custom class, contactInfo. Which is the correct definition of the Apex method that gets additional information?

Question4: A developer has an integer variable called maxAttempts. The developer meeds to ensure that once maxAttempts is initialized, it preserves its value for the lenght of the Apex transaction; while being able to share the variable's state between trigger executions. How should the developer declare maxAttempts to meet these requirements?

Question5: Cloud Kicks Fitness, an ISV Salesforce partner, is developing a managed package application. One of the application modules allows the user to calculate body fat using the Apex class, BodyFat, and its method, calculateBodyFat(). The product owner wants to ensure this method is accessible by the consumer of the application when developing customizations outside the ISV's package namespace.
Which approach should a developer take to ensure calculateBodyFat() is accessible outside the package namespace?

Question6: A custom picklist field, Food_Preference__c, exist on a custom object. The picklist contains the following options: 'Vegan','Kosher','No Preference'. The developer must ensure a value is populated every time a record is created or updated. What is the most efficient way to ensure a value is selected every time a record is saved?

Question7: A developer must implement a CheckPaymentProcessor class that provides check processing payment capabilities that adhere to what defined for payments in the PaymentProcessor interface. public interface PaymentProcessor { void pay(Decimal amount); } Which is the correct implementation to use the PaymentProcessor interface class?

Question8: What are two ways for a developer to execute tests in an org?

Question9: A developer has a Apex controller for a Visualforce page that takes an ID as a URL parameter. How should the developer prevent a cross site scripting vulnerability?

Question10: What are three ways for a developer to execute tests in an org? Choose 3.

Question11: which statement is true regarding execution order when triggers are associated to the same object and event?

Question12: Universal Containers has large number of custom applications that were built using a third-party javaScript framework and exposed using Visualforce pages. The Company wants to update these applications to apply styling that resembles the look and feel of Lightning Experience. What should the developer do to fulfill the business request in the quickest and most effective manner?

Question13: Which code displays the contents of a Visualforce page as a PDF?

Question14: In terms of the MVC paradigm, what are two advantages of implementing the layer of a Salesforce application using Aura Component-based development over Visualforce? Choose 2 answers

Question15: An Apex method, getAccounts, that returns a List of Accounts given a search Term, is available for Lighting Web components to use. What is the correct definition of a Lighting Web component property that uses the getAccounts method?

Question16: If apex code executes inside the execute() method of an Apex class when implementing the Batchable interface, which statement are true regarding governor limits? Choose 2 answers

Question17: A developer must write an Apex method that will be called from a Lightning component. The method may delete an Account stored in the accountRec variable.
Which method should a developer use to ensure only users that should be able to delete Accounts can successfully perform deletions?

Question18: Refer to the following code that runs in an Execute Anonymous block:

Question19: A developer writes a trigger on the Account object on the before update event that increments a count field. A workflow rule also increments the count field every time that an Account is created or update. The field update in the workflow rule is configured to not re-evaluate workflow rules. What is the value of the count field if an Account is inserted with an initial value of zero, assuming no other automation logic is implemented on the Account?

Question20: A developer created a Visualforce page and custom controller to display the account type field as shown below. Custom controller code: public class customCtrlr{ private Account theAccount; public String actType; public customCtrlr() { theAccount = [SELECT Id, Type FROM Account WHERE Id =
:apexPages.currentPage().getParameters().get('id')]; actType = theAccount.Type; } } Visualforce page snippet:
The Account Type is {!actType} The value of the account type field is not being displayed correctly on the page. Assuming the custom controller is property referenced on the Visualforce page, what should the developer do to correct the problem?

Question21: While writing a test class that covers an OpportunityLineItem trigger, a Developer is unable to create a standard PriceBook since one already exists in the org.
How should the Developer overcome this problem?

Question22: Application Events follow the traditional publish-subscribe model. Which method is used to fire an event?

Question23: A developer wrote Apex code that calls out to an external system. How should a developer write the test to provide test coverage?

Question24: A developer needs to implement the functionality for a service agent to gather multiple pieces of information from a customer in order to send a replacement credit card.
Which automation tool meets these requirements?

Question25: How many accounts will be inserted by the following block ofcode? for(Integer i = 0 ; i <
500; i++) { Account a = new Account(Name='New Account ' + i); insert a; }
* 0
87. Boolean odk;
Integer x;
if(abok=false;integer=x;){
X=1;
}elseif(abok=true;integer=x;){
X=2;
}elseif(abok!=null;integer=x;){
X=3;
)elseif{
X=4;}

Question26: How can a developer check the test coverage of active Process Builder and Flows deploying them in a Changing Set?

Question27: What should a developer use to obtain the Id and Name of all the Leads. Accounts, and Contacts that hove the company name "Universal Containers"?

Question28: Which three operations affect the number of times a trigger can fire?
Choose 3 answers

Question29: What are two ways for a developer to execute tests in an org?

Question30: What does the Lightning Component framework provide to developers?

Question31: A developer identifies the following triggers on the Expense_c object:
* DeleteExpense,
* applyDefaultstoexpense
* validateexpenseupdate;
The triggers process before delete, before insert, and before update events respectively.
Which two techniques should the developer implement to ensure trigger best practice are followed?

Question32: An Apex method, getAccounts, that returns a List of Accounts given a searchTerm, is available for Lightning Web components to use.
What is the correct definition of a Lightning Web component property that uses the getAccounts method?

Question33: Which three statements are true regarding custom exceptions in Apex? (Choose three.)

Question34: A developer writes a trigger on the Account object on the before update event that increments a count field. A workflow rule also increments the count field every time that an Account is created or updated. The field update in the workflow rule is configured to not re-evaluate workflow rules.
What is the value of the count field if an Account is inserted with an initial value of zero, assuming no other automation logic is implemented on the Account?

Question35: A developer must create a ShippingCalculator class that cannot be instantiated and must include a working default implementation of a calculate method, that sub-classes can override.
What is the correct implementation of the ShippingCalculator class?

Question36: A developer must provide a custom user interface when users edit a Contact. Users must be able to use the interface in Salesforce Classic and Lightning Experience.
What should the developer do to provide the custom user interface?

Question37: Universal Containers recently transitioned from Classic to Lighting Experience. One of its business processes requires certain value from the opportunity object to be sent via HTTP REST callout to its external order management system based on a user-initiated action on the opportunity page. Example values are as follow
* Name
* Amount
* Account
Which two methods should the developer implement to fulfill the business requirement? (Choose 2 answers)

Question38: A developer needs an Apex method that can process Account or Contact records. Which method signature should the developer use?

Question39: A developer of Universal Containers is tasked with implementing a new Salesforce application that must be able to by their company's Salesforce administrator.
Which three should be considered for building out the business logic layer of the application? Choose 3 answers

Question40: A developer observes that an Apex test method fails in the Sandbox. To identify the issue, the developer copies the code inside the test method and executes it via the Execute Anonymous tool in the Developer Console. The code then executes with no exceptions or errors. Why did the test method fail in the sandbox and pass in the Developer Console?

Question41: A Lightning component has a wired property, searchResults, that stores a list of Opportunities. Which definition of the Apex method, to which the searchResults property is wired, should be used?

Question42: What are two characteristics related to formulas? Choose 2 answers.

Question43: Which statement generates a list of Leads and Contacts that have a field with the phrase 'ACME'?

Question44: A developer considers the following snippet of code:

Based on this code, what is the value of x?

Question45: What is a key difference between a Master-Detail Relationship and a Lookup Relationship?

Question46: What is the result of the following code?

Question47: Which three data types can a SOQL query return? Choose 3 answers

Question48: The following Apex method is part of the ContactService class that is called from a trigger: public static void setBusinessUnitToEMEA(Contact thisContact){ thisContact.Business_Unit__c = "EMEA" ; update thisContact; } How should the developer modify the code to ensure best practice are met?

Question49: Which standard field is required when creating a new contact record?

Question50: what are the methods used to show input in classic and lightning ?

Question51: Which two events need to happen when deploying to a production org? Choose 2 answers

Question52: A Salesforce developer wants to review their code changes immediately and does not want to install anything on their computer or on the org.
Which tool is best suited?

Question53: Which two are best practices when it comes to component and application event handling? (Choose two.)

Question54: Universal Containers decides to use exclusively declarative development to build out a new Salesforce application. Which three options should be used to build out the database layer for the application? Choose 3 answers